Skip to content

feat(id): fail-closed provisioning gate for hosted enablement (#3403) - #12985

Merged
dezren39 merged 1 commit into
mainfrom
lane-hp/3403-provisioning-gate
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-hp/3403-provisioning-gate

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

The #3403 provisioning gate: pkgs/id/hosted-worker/src/provisioning.ts — a pure, fail-closed validator that is now the only route to a hosted production signup/migration enablement plan. It validates a deployment configuration against deployed-account evidence (the #2285 canary results + Cloudflare API read-backs), per the #2283 design's provisioning-gate step and the 2026-11-22 decision record on #3403.

Refusals (explicit FailClosed diagnostics, one per acceptance failure mode):

  • missing_jurisdiction / unsupported_jurisdiction — the jurisdiction must be explicitly configured and supported; the design's policy constant is not a silent default.
  • unrestricted_fallback_forbidden — enablement exists only on the jurisdiction-restricted DO namespace.
  • jurisdiction_unverified / jurisdiction_unavailable — evidence must prove restricted DO support on the actual account; the acceptance-required unavailable US case refuses as jurisdiction_unavailable.
  • unsupported_runtime_types / runtime_types_unverified — deployed runtime + generated types must be proven to support the restriction.
  • bucket_missing / bucket_unverified / bucket_jurisdiction_mismatch — the bucket's actual jurisdiction, read back from the R2 API, must match. A binding's declared jurisdiction field is checked only for consistency and is never accepted as verification — the id: PoC: verify DO jurisdiction mechanics and confirm vendor residency guarantees #2285 Half 1 lesson (a plain binding reached the EU bucket; wrangler's --jurisdiction flag was silently ignored).

On success it returns the exact plan: jurisdiction, DO binding, and the one verified bucket.

Evidence

Scope

The validator consumes evidence only — it probes no account, provisions nothing, and authorizes no deployment by itself. Wiring it into an actual provisioning/deployment surface (and the API provisioning that produces the evidence) is the named next slice on #3403; this PR deliberately does not close the issue.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Add src/provisioning.ts to pkgs/id/hosted-worker: a pure validator
that grants a production signup/migration enablement plan only when
the deployment configuration is validated against deployed-account
evidence (the #2285 canary results and R2 API read-backs):

- jurisdiction must be explicitly configured and supported — the
  design's policy constant is not a silent default;
- enablement requires the jurisdiction-restricted Durable Object
  namespace — no unrestricted fallback;
- evidence must prove restricted DO support and runtime/types
  support on the actual account ("unavailable US" refuses with
  jurisdiction_unavailable; anything unproven refuses as
  unverified);
- the bucket's ACTUAL jurisdiction, read back from the R2 API, must
  match the configured jurisdiction — a binding's declared
  jurisdiction field is checked only for consistency and is never
  accepted as verification (the #2285 Half 1 lesson: a plain binding
  reached the EU bucket, and wrangler's --jurisdiction flag was
  silently ignored).

17 configuration tests cover every acceptance failure mode. The
validator consumes evidence only; it probes no account and authorizes
no deployment by itself.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2735a29-4872-4171-8248-3baacabe6f69
Commits

Reviewing files that changed from the base of the PR and between 39446aa and 2279dc9.

Files selected for processing: 3

  • pkgs/id/hosted-worker/package.json
  • pkgs/id/hosted-worker/src/provisioning.ts
  • pkgs/id/hosted-worker/test/provisioning.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T06:26:07.278593Z 2279dc9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 662beb7 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-hp/3403-provisioning-gate branch November 23, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant